home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 98 / CD-ROM 98.iso / infantil / tuxmath / tuxmath-2001.09.07-win32-installer.exe / src / game.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-08-31  |  981 b   |  68 lines

  1. /*
  2.   game.h
  3.  
  4.   For TuxMath
  5.   The main game loop!
  6.  
  7.   by Bill Kendrick
  8.   bill@newbreedsoftware.com
  9.   http://www.newbreedsoftware.com/
  10.  
  11.  
  12.   Part of "Tux4Kids" Project
  13.   http://www.tux4kids.org/
  14.       
  15.   August 26, 2001 - August 31, 2001
  16. */
  17.  
  18.  
  19. #ifndef GAME_H
  20. #define GAME_H
  21.  
  22. #define MAX_COMETS 10
  23. #define NUM_CITIES 4   /* MUST BE AN EVEN NUMBER! */
  24.  
  25. #define NUM_BKGDS 5
  26.  
  27. #define MAX_CITY_COLORS 4
  28.  
  29. typedef struct comet_type {
  30.   int alive;
  31.   int expl;
  32.   int city;
  33.   int x, y;
  34.   int eq1, oper, eq2;
  35.   int answer;
  36. } comet_type;
  37.  
  38. typedef struct city_type {
  39.   int alive, expl, shields;
  40.   int x;
  41. } city_type;
  42.  
  43. typedef struct laser_type {
  44.   int alive;
  45.   int x1, y1;
  46.   int x2, y2;
  47. } laser_type;
  48.  
  49. enum {
  50.   OPER_ADD,
  51.   OPER_SUB,
  52.   OPER_MULT,
  53.   OPER_DIV,
  54.   NUM_OPERS
  55. };
  56.  
  57. static char operchars[NUM_OPERS] = {
  58.   "+-*/"
  59. };
  60.  
  61. static char * oper_opts[NUM_OPERS] = {
  62.   "add", "subtract", "multiply", "divide"
  63. };
  64.  
  65. int game(void);
  66.  
  67. #endif
  68.